package command.psicologos;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import command.ICommand;

import dao.PsicologoDAO;

public class DeletarPsicologoCommand implements ICommand{

	public String execute(HttpServletRequest request) throws ServletException,IOException {
		String cod = request.getParameter("codigo");
		int codigo = Integer.parseInt(cod);
		PsicologoDAO psicoDAO = new PsicologoDAO();
		try {
			psicoDAO.deletar(codigo);
			return "controller.do?acao=listarPsicologos";
		} catch (SQLException e) {
			e.printStackTrace();
			return "#";
		}
	}
}
